<%
    Cookie cookie = new Cookie("magUserId", null);
    cookie.setMaxAge(0);
    cookie.setPath("/");
    response.addCookie(cookie);

    String redirectURL = request.getHeader("referer");
    response.sendRedirect(redirectURL);
%> 